<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>No.2商城-注册</title>

<?php
//header("Content-Type: text/html;charset=utf8");
session_start();
$username = $_POST['username'];
$psd1 = $_POST['psd1'];
$psd2 = $_POST['psd2'];
$email = $_POST['email'];
$sex = $_POST['gender'];
$psd = md5($psd2);
$useryzm = $_POST['useryzm'];
$yzmchar = $_SESSION['string'];
if (strtoupper($yzmchar) == strtoupper($useryzm)) {
    echo "<script>";
//    echo "alert('注册成功');";
//    echo "url='';";
    echo "window.location.href='registerSuccess.php?un=$username&pd=$psd&em=$email&sx=$sex';";
    echo "</script>";
} else {
    include 'register.php';
    echo "<script>";
    echo "onInitialization();";
    echo "$('#username').val('$username');";
    echo "$('#usernameMsg').html('用户名可用').css('color', 'green');";
    echo "$('#psd1').val('$psd1');";
    echo "$('#psd2').val('$psd2');";
    echo "$('#helpBlock2').html('两次密码一致').css('color', 'green');";
    echo "$('#email').val('$email');";
    echo "$('#emailMsg').html('邮箱可用').css('color', 'green');";
    echo "$('#helpyzm').html('验证码输入错误，请重新输入，看不清点击图片换一张').css('color', 'red');";
    echo "$('#registerBtn').removeAttr('disabled');";
    echo "</script>";
}
?>